﻿// Module:             Games Programming
// Assignment1:        Platformer Game
// Add game feature:   Gem
// Student Number:     S10096666C
// Student Name:       Trinh Quang Anh

//////////////////////////////////////////////////////////////////////////

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Game
{
    public class Gem
    {
        private readonly Vector2 _position;
        private readonly Texture2D _texture;
        private readonly Rectangle _boundingRect;

        public Gem(Texture2D texture, int x, int y)
        {
            _texture = texture;
            _position = new Vector2(x * Game1.GridSize, y * Game1.GridSize);
            _boundingRect = new Rectangle((int)_position.X, (int)_position.Y, texture.Width,texture.Height);
        }

        public Vector2 Position
        {
            get { return _position; }
        }

        public Rectangle BoundingRect
        {
            get { return _boundingRect; }
            //set { _boundingRect = value; }
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(_texture,_position, Color.White);
        }
    }
}
